package interfaceusuario;

import javax.swing.JFrame;

//util para algumas telas passarem o JFrame entre elas, jah que a maioria das telas reusa o jframe.
public class SingletonGuardaJanelaTestable 
{
	private volatile static SingletonGuardaJanelaTestable instanciaGuardaJanelaTestable;
	private JFrame janelaPrincipalTestableGuardada;
	
	public synchronized static SingletonGuardaJanelaTestable getInstance()
	{
		if(instanciaGuardaJanelaTestable == null)
		{
			instanciaGuardaJanelaTestable = new SingletonGuardaJanelaTestable();
		}
		
		return instanciaGuardaJanelaTestable;
	}
	
	public synchronized void guardarJanelaPrincipalTestable(JFrame janelaParaGuardar)
	{
		this.janelaPrincipalTestableGuardada = janelaParaGuardar;
	}
	
	public synchronized JFrame pegarJanelaPrincipalGuardadaTestable()
	{
		if(janelaPrincipalTestableGuardada == null)
		{
			janelaPrincipalTestableGuardada = new JFrameComMenu("testable");
		}
		return this.janelaPrincipalTestableGuardada;
	}

}
